package com.qing.microservices.shirostudy.controller;

import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresGuest;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author guoqf
 */
@Slf4j
@Controller
@RequestMapping("order")
public class OrderController {

    @RequiresRoles(value = "admin")
    @RequestMapping("addition")
    public String save() {
        log.info("拥有订单新增权限");
        return "order-add";
    }

    @RequiresRoles(value = "user")
    @RequestMapping("modification")
    public String update() {
        log.info("拥有订单更新权限权限");
        return "order-mod";
    }

    @RequestMapping("list")
    public String query() {
        log.info("拥有订单查询权限");
        return "order-list";
    }


    @RequiresRoles(value = "admin")
    @RequestMapping("deletion")
    public String delete() {
        log.info("拥有订单删除权限权限");
        return "order-del";
    }

}
